USE loghog;
GO
CREATE TRIGGER Inserted ON Value
INSTEAD OF INSERT
AS
BEGIN
	SET NOCOUNT ON;
	DECLARE @Value as Varchar(MAX);
	SET @Value = (SELECT BLOB FROM inserted);
	INSERT INTO Value (BLOB) VALUES ((EncryptByCert(Cert_ID('loghog'), @Value)));
END
GO